﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SzCourt.Logic.BLL;
using KMFrame.Permission.Util;

namespace SzCourt.WebSite.facebook
{
    public partial class success : System.Web.UI.Page
    {
        private string _Dept = string.Empty;
        private string _Content = string.Empty;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                getParam();
                createrInfo();
            }
        }

        //获取参数值
        private void getParam()
        {
            this._Dept = string.IsNullOrEmpty(Request.Form["txtDept"]) ? "" : Request.Form["txtDept"];
            this._Content = string.IsNullOrEmpty(Request.Form["txtContent"]) ? "" : Request.Form["txtContent"];
        }

        private void createrInfo()
        {
            if (!SessionBox.CheckUserSession())
            {
                Response.Redirect("/shenwu/login/login.aspx");
            }
            IdeasBox bll = new IdeasBox();
            bool result = (bool)bll.CreateIdeasBox(SessionBox.GetUserSession().UserID,SessionBox.GetUserSession().UserName,this._Dept, this._Content);
            
            if (result)
            {
                this.spMessage.InnerHtml = "留言成功！";
            }
            else
            {
                this.spMessage.InnerHtml = "留言失败！";
            }
        }

    }
}